﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using GNSWebSite.Managers;

namespace GNSWebSite.Pages
{
    public partial class Activation : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string userID = Request.QueryString["id"];
                Guid gd = new Guid(userID);
                MembershipUser user = Membership.GetUser(gd);
                if (user != null)
                {
                    user.IsApproved = true;
                    Membership.UpdateUser(user);
                    lblMessages.Text = (string)GetLocalResourceObject("SuccessMessage");
                }
                else
                {
                    lblMessages.Text = (string)GetLocalResourceObject("ErrorMessage");
                }
            }
        }
    }
}
